package com.caigou.modules.famous.adpter

import android.widget.TextView
import com.caigou.comm.base.ext.dareTypeBackgroundId
import com.caigou.modules.famous.R
import com.caigou.modules.famous.bean.MyRecordItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/12/08
 */
class PublishTypeItemAdapter(dataset: MutableList<MyRecordItemBean>) :
    BaseQuickAdapter<MyRecordItemBean, BaseViewHolder>(R.layout.item_publish_type_list, dataset) {

    override fun convert(holder: BaseViewHolder, item: MyRecordItemBean) {
        holder.getView<TextView>(R.id.item_publish_type_tv_type).setBackgroundResource(dareTypeBackgroundId(item.dareTypeId))
        holder.setText(R.id.item_publish_type_tv_type, item.dareTypeName)
        holder.setText(R.id.item_publish_type_tv_record, "战绩：${item.count}对${item.successCount}")
        holder.setText(R.id.item_publish_type_tv_time, item.updateTime)
        holder.setText(R.id.item_publish_type_tv_like_num, item.nicePoint.toString())
    }
}